import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import login from '../views/login/index'
import user from '../views/user/User'
import add from '../views/user/add'
import edit from '../views/user/edit'
import yh from '../views/yonghu/index'
import yhAdd from '../views/yonghu/add'
import yhEdit from '../views/yonghu/yhedit'
import order from '../views/order form/index'
import zy from '../views/sousuo'

Vue.use(VueRouter)

const routes = [{
        path: '/',
        name: 'home',
        component: Home,
        children: [{
            path: '/user',
            name: 'user',
            component: user
        }, {
            path: '/add',
            name: 'add',
            component: add
        }, {
            path: "/edit",
            name: "edit",
            component: edit
        }, {
            path: "/yh",
            name: "yh",
            component: yh
        }, {
            path: "/yhAdd",
            name: "yhAdd",
            component: yhAdd
        }, {
            path: "/yhEdit",
            name: "yhEdit",
            component: yhEdit
        }, {
            path: "/order",
            name: "order",
            component: order
        }, {
            path: "/",
            name: "zy",
            component: zy
        }]
    },
    {
        path: '/about',
        name: 'about',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/About.vue')
    },
    {
        path: '/login',
        name: 'login',
        component: () =>
            import ('../views/login/index.vue')
    }
]

const router = new VueRouter({
    routes
})

export default router